package Java;

import java.util.Scanner;

public class test24 {
//    用户输入整数n，计算1!+(1!+2!)+(1!+2!+3!)+…..+(1!+2!+…n!)
//    用方法实现     sum+sum*n+sum*n
//    有参数有返回值
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(jieceng(n));
    }
    public  static  double jieceng(int n){
        int sum=1;
        int zong=0;
        for (int i=1;i<=n;i++){
            sum=i*sum;
            zong+=sum;
        }
        return zong;
    }
}
